﻿using Enyim.Caching;
using Web.Controllers;
using System.Web.Mvc;
using SilenthinkContract;
using Web.Areas.My.Models;
using SilenthinkCommon.Extension;

namespace Web.Areas.My.Controllers
{
    /// <summary>
    /// 充值
    /// </summary>
    public class RechargeController : MyBaseController
    {
        public RechargeController(ILogService logService, IBaseService baseService, IExtraService extraService, IStoreService storeService, IOrderService orderService, IGameService gameService, IAuctionService auctionService, IPassportService passportService, IPaymentService paymentService, IMemcachedClient memcachedClient) : base(logService, baseService, extraService, storeService, orderService, gameService, auctionService, passportService, paymentService, memcachedClient)
        {
        }

        /// <summary>
        /// 充值
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(int page = 1, int size = 20)
        {
            var identity = User.Identity.SkIdentity();
            var model = new RechargeControllerModel.Index();
            model.Account = PaymentService.GetUserAccount(identity.Id);
            model.Recharges = PaymentService.GetPagedUserRecharge(identity.Id, null, null, page, size).ToPagedList(page,size);
            return View(model);
        }
        /// <summary>
        /// 明细
        /// </summary>
        /// <returns></returns>
        public ActionResult Detail(byte? status = null, int page = 1, int size = 20)
        {
            var identity = User.Identity.SkIdentity();
            var model = new RechargeControllerModel.Detail();
            model.Account = PaymentService.GetUserAccount(identity.Id);
            //model.Recharges = passportExtraService.GetPagedUserRecharge(identity.Id, status, page, size).ToPagedList(page, size);
            return View(model);
        }
    }
}
